package com.game.view.layer.loadingBar
{
	import com.game.view.layer.LayerBase;
	import com.greensock.TweenMax;
	
	public class LoadingBarBase extends LayerBase
	{
		public function LoadingBarBase()
		{
			x = 940 / 2;
			y = 590 / 2;
		}
		
		public function onProgress(data:Object):void
		{
			setProcess(data);
		}
		
		public function onComplete():void
		{
			dispose();
		}
		
		protected function setProcess(data:Object):void
		{
			//在子类中覆写实现
		}
		
		public function dispose():void
		{
			TweenMax.to(this, 0.4, {"alpha": 0, "scaleX": 1.2, "scaleY": 1.2});
			TweenMax.delayedCall(0.5, function (bar:LoadingBarBase):void
			{
				bar.removeFromParent();
			}, [this]);
		}
	}
}
